package com.study.d012Components;

import javafx.application.Application;
import javafx.geometry.Orientation;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Separator;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;

/**
*@description 分隔符   49课
*@author xtayhame
*date 2020年3月3日
*version
*since v1.0
*/
public class SeparatorMain extends Application{
	public static void main(String[] args) {
		launch(args);
	}

	@Override
	public void start(Stage stage) throws Exception {
		AnchorPane anchorPane = new AnchorPane();

		HBox hb = new HBox();

		Button b1= new Button("按钮1");

		Button b2= new Button("按钮2");

		Separator s1 = new Separator();
		s1.setPrefWidth(100);
		s1.setPrefHeight(200);
		//设置方向，默认水平， 类似菜单栏中的分隔符
		s1.setOrientation(Orientation.VERTICAL);

		hb.getChildren().addAll(b1,s1,b2);

		anchorPane.getChildren().add(hb);

		stage.setScene(new Scene(anchorPane, 300, 400));

		stage.show();
	}
}
